package com.relytosoft.mizar.analyze.structure.services.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.relytosoft.mizar.analyze.structure.api.entity.AyStructureTaskSon;
import com.relytosoft.mizar.analyze.structure.api.pojo.query.AyStructureTaskSonQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: zyc
 * @version: v1.0
 * @description: com.relytosoft.mizar.analyze.structure.services.mapper
 * @Date: 2022/5/12 17:50
 */
@Mapper
public interface AyStructureTaskSonMapper extends BaseMapper<AyStructureTaskSon> {

    /**
     * 根据设备id查询是否有未删除的任务
     *
     * @param cameraId
     * @return
     */
    Integer selectTaskSonById(@Param("cameraId") String cameraId);

    /**
     * 分页查询子任务列表
     *
     * @param page
     * @param ayStructureTaskSonQuery
     * @return
     */
    Page<AyStructureTaskSon> selectPageTaskSonList(@Param("page") Page<AyStructureTaskSon> page, @Param("ayStructureTaskSonQuery") AyStructureTaskSonQuery ayStructureTaskSonQuery);

    /**
     * 查询子任务id
     *
     * @param ayStructureTaskId
     * @return
     */
    List<Integer> selectSonIds(@Param("ayStructureTaskId") Integer ayStructureTaskId);

    /**
     * 查询子任务状态
     *
     * @param ayStructureTaskId
     * @return
     */
    List<Integer> selectStatusList(@Param("ayStructureTaskId") Integer ayStructureTaskId);

    /**
     * 通过任务ID查找子任务
     *
     * @param taskID
     * @return
     */
    AyStructureTaskSon getByTaskId(@Param("taskId") String taskID);
}
